from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.
class UserInfo(AbstractUser):
    is_delete = models.IntegerField(default=0,verbose_name='是否删除')

    class Meta:
        db_table = 'userinfo'
        verbose_name = '用户信息'
        verbose_name_plural = verbose_name


class UserAddress(models.Model):
    recv = models.CharField(max_length=10,null=False,verbose_name='收件人')
    recv_phone = models.IntegerField(verbose_name='收货人联系方式')
    service_phone = models.IntegerField(verbose_name='客服电话')
    address = models.CharField(max_length=50,verbose_name='收货人地址')
    is_delete = models.IntegerField(default=0,verbose_name='是否删除')
    user = models.ForeignKey('UserInfo',null=False,verbose_name='所属的用户')

    class Meta:
        verbose_name = '用户地址'
        verbose_name_plural = verbose_name
    # def __str__(self):
    #     return self.recv

